package cn.com.gridinfo.sooc.utils.widget;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.animation.Interpolator;
import android.widget.Scroller;

/**
 * 滑屏速度控制
 */
public class MySpeedScroller extends Scroller {

    private int mDuration = 0; // 图片转动时间为500ms;

    public MySpeedScroller(Context context) {

        super(context);

    }
    public MySpeedScroller(Context context , int mDuration) {
        super(context);
        this.mDuration = mDuration;
    }
    public MySpeedScroller(Context context, Interpolator interpolator) {

        super(context, interpolator);

    }

    public MySpeedScroller(Context context, Interpolator interpolator, int mDuration) {

        super(context, interpolator);
        this.mDuration = mDuration;
    }

    @SuppressLint("NewApi")
    public MySpeedScroller(Context context, Interpolator interpolator,
                           boolean flywheel) {

        super(context, interpolator, flywheel);

    }

    @Override
    public void startScroll(int startX, int startY, int dx, int dy, int duration) {

        // Ignore received duration, use fixed one instead

        super.startScroll(startX, startY, dx, dy, mDuration);

    }

    @Override
    public void startScroll(int startX, int startY, int dx, int dy) {

        // Ignore received duration, use fixed one instead

        super.startScroll(startX, startY, dx, dy, mDuration);
    }

}
